<?php
if(isset($_SESSION['aid'])){
    $aid = $_SESSION['aid'];
    $operator_name_query = "SELECT `operator_name` FROM `admin` WHERE `aid` = :aid";
    $sth_operator_name  = $dbh->prepare($operator_name_query);
    $sth_operator_name   ->bindParam(":aid",$aid);
    $sth_operator_name   ->execute();
    $operator_name  = $sth_operator_name->fetch()['operator_name'];
}
echo <<<EOT
    <!DOCTYPE HTML>
    <html>
    <head>
        <title>Afctf</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="/afctf/layui/css/layui.css" rel="stylesheet" type="text/css" media="all"/>
        <link href="/afctf/css/style.css" rel="stylesheet" type="text/css" media="all" />
        <link href="/afctf/css/reset.css" rel="stylesheet" type="text/css" media="all" />
        <link href="/afctf/css/countdown.css" rel="stylesheet" type="text/css" media="all" />
        <link href="/afctf/css/challenge.css" rel="stylesheet" type="text/css" media="all" />
        <script src="/afctf/js/jquery-3.3.1.min.js"></script> 
        <script src="/afctf/js/layer/layer.js"></script>
        <script src="/afctf/js/echarts.min.js"></script>
        <script src="/afctf/js/utils.js"></script>
        <script src="/afctf/js/challenge.js"></script>
        <script src="/afctf/js/inputLimit.js"></script>
        

    </head>
    <body>
    <div class="bh">
        <div class="header">
            <div class="logo">
                <h1><a href="index.php"><img src="/afctf/images/logo.png" alt=""></a></h1>
            </div>
            <div class='cssmenu' style="margin-left: 0;flex: 0 0 60%;max-width: 60%;display: block;width: 100%">
                <ul>
                    <li class='active' id="a_home"><a href='index.php'><span>首页</span></a></li>
                    <li id="a_challenge"><a href='challenge.php'><span>赛题管理</span></a></li>
                    <li id="a_announcement"><a href='announcement.php'><span>公告发布</span></a></li>
                    <li id="a_solved"><a href='solved.php'><span>答题情况</span></a></li>
                    <li id="a_player"><a href='player.php'><span>选手信息</span></a></li>
                    <li id="a_reset"><a href='resetpw.php?action=resetpw'><span>密码重设</span></a></li>
                    <li id="a_register"><a href='register.php?action=register'><span>管理员注册</span></a></li>
                </ul>
            </div>
            <div class='cssmenu' style="margin-left: 0;flex: 0 0 20%;max-width: 20%;display: block;width: 100%">
                <ul>
                    <li id="a_operatorName"><span style="margin-right:20px">$operator_name</span></li>
                    <li><span>/</span></li>
                    <li id="a_logout"><a href="index.php?action=logout" style="">退出登录</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="maincontainer">
EOT;
?>